import WSRequest from "../index";
import { accountType } from "./types";
enum loginApi {
  AccountLogin = "/login",
  LoginUserInfo = "/users/",
  LoginUserMenu = "/role/", //  /role/1/menu
}
export const accountLogin = (account: accountType) => {
  return WSRequest.post({
    url: loginApi.AccountLogin,
    data: {
      name: account.username,
      password: account.password,
    },
  });
};

export const reqUserInfo = (id: number) => {
  return WSRequest.get({
    url: loginApi.LoginUserInfo + id,
  });
};

export const reqUserMenu = (id: number) => {
  return WSRequest.get({
    url: loginApi.LoginUserMenu + id + "/menu",
  });
};
